package com.ccnu.sm.controller;

import com.ccnu.sm.domain.Book;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping(value="/book")
public class BookController {
	private static final Log logger = LogFactory.getLog(BookController.class);
	
	@RequestMapping(value="/")
	public String page(HttpServletResponse response) {
		logger.info("BookController.page 正在被调用");
		@SuppressWarnings("unused")
		ObjectMapper mapper = new ObjectMapper();
		return "book";
	}
	
	@RequestMapping(value="/lists")
	public String getBookList(@RequestBody Book book,
			HttpServletResponse response) {
		@SuppressWarnings("unused")
		ObjectMapper mapper = new ObjectMapper();
		return "book";
	}
}
